<template>
<div style="width: 100%;height: 100%;">
  <div class="add"  @click="download()">下载</div>
    <!-- <iframe  style="width: 100%;height: 100vh;" :src="url"></iframe> -->
    <!-- <iframe  style="width: 100%;height: 100vh;" :src="url2"></iframe> -->

    <office-preview :visible.sync="previewVisible" v-if="previewVisible" :client-height="clientHeight"
                    :file="previewFile" :base-u-r-l="baseUrl"></office-preview>

</div>
</template>
<script>
// import mammoth from 'mammoth'
import officePreview from "./officePreview";

 export default {
  data() {
    return{
      baseUrl: process.env.VUE_APP_BASE_API,
        url:'',
        url2:'',
        previewVisible:true,
        clientHeight:200,
        // previewFile:{name:'wwwwwww',url:'http://qtyj.safetyhua.com/Uploads/00031/20240807/49460007-1bdf-466b-ac42-8bb6c83d5258.docx'},
        previewFile:{},

    }
  },
  components: {
	officePreview
},
  created(){
    this.previewFile.name=this.$route.query.name
    this.previewFile.url=this.$route.query.url
  },
  methods:{
    download(){
      window.open(this.baseUrl+this.previewFile.url,'_self');
    }
  }
}
</script>   